package com.dms.shanshan.core;

import com.dms.shanshan.util.ReadHSSFExcel;
import com.dms.shanshan.util.XMLWriter;
import org.xml.sax.SAXException;

import javax.xml.parsers.ParserConfigurationException;
import java.io.IOException;
import java.util.Map;

public class StrategyInfo {
    public static String getStrategy(String filePath) throws IOException, ParserConfigurationException, SAXException {
        Map XMLmap= XMLWriter.getXMLMap();
        Map ExcelData=ReadHSSFExcel.readExcel(filePath);
        String methodName= (String) XMLmap.get(ExcelData);
        return methodName;
    }
    public  static void processStrategy(String filePath,String basePackage) throws IOException, ParserConfigurationException, SAXException {
        ExcelStrategyFactory factory=new ExcelStrategyFactory(basePackage);
        factory.handle(getStrategy(filePath));
    }

    public static void main(String[] args) throws IOException, ParserConfigurationException, SAXException {
        System.out.println(getStrategy("D://直报表.xls"));
    }
}

